<div>
    <div class="bg-white rounded-xl p-6 pb-4">
        <div class="text-lg mb-2">{{ $year ?? date('Y') }}年文章</div>
        @if(count($articles) == 0)
            <div class="text-center mt-10">
                <p class="text-base font-semibold text-indigo-600">暂无数据</p>
                <p class="mt-6 text-base leading-7 text-gray-600">作者太懒了，一篇文章都没有~</p>
            </div>
        @endif
        @foreach($articles as $article)
            <div class="border-0 pt-3 pb-3 border-b border-color-body-line flex items-center justify-between">
                <div>
                    <span
                        class="inline-flex items-center rounded-md bg-green-50 px-2 py-1 text-xs font-medium text-green-700 ring-1 ring-inset ring-green-600/20">{{ $article->category['name'] }}</span>

                    <a href="/article/{{ $article['id'] }}"
                       target="_blank" class="text-base pl-2">
                        {{ $article['title'] }}
                    </a>
                </div>
                <div class="flex items-center text-gray-400 pt-2 flex items-center pb-2 text-sm">
                    <i class="iconfont icon-time mr-1"></i>
                    {{ $article->created_at->format('Y-m-d') }}
                    <span>&nbsp;|&nbsp;</span>
                    <i class="iconfont icon-eye mr-1"></i>
                    {{ $article->reading_quantity }}
                    <span>&nbsp;</span>
                </div>
            </div>
        @endforeach

        <div class="m-auto mt-3 mb-5">
            {{ $articles->links() }}
        </div>
    </div>
</div>
